using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Player : MonoBehaviour
{
    private Rigidbody2D _rigidbody;

    // Start is called before the first frame update
    void Start()
    {
        _rigidbody = GetComponent<Rigidbody2D>();

    }

    // Update is called once per frame

    private void OnCollisionEnter2D(Collision2D collision)

    {
        if (collision.gameObject.tag == "Enemy")
        {
            _rigidbody.velocity = Vector3.zero;
            _rigidbody.angularVelocity = 0.0f;


            this.gameObject.SetActive(false);
            //gameManager.PlayerDied();
            FindObjectOfType<GameManager>().PlayerDied();
        }
    }
}
